<?php

namespace app\common\validate\business;

use think\Validate;

class Commission extends Validate
{
    protected $rule = [
        'orderid' => ['require'],
        'busid' => ['require'],
        'parentid' => ['require'],
        'amount' => ['require', '>:0'],
        'type' => ['require', 'in:subject,product'],
        'status' => ['require', 'in:0,1']
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     * @var array
     */
    protected $message = [
        'orderid.require' => '未知订单',
        'busid.require' => '未知用户',
        'parentid.require' => '未知上级',
        'amount.require' => '佣金必填',
        'type.require' => '未知佣金类型',
        'type.in' => '佣金类型的值有误',
        'status.require' => '未知状态',
        'status.in' => '佣金提现状态有误',
        'amount.>'  => '佣金必须大于0元',
    ];

    /**
     * 验证场景定义
     * 格式：'场景名称'	=>	['字段1','字段2'...]
     * @var array
     */
    protected $scene = [];
}
